-- GENERATED SPELL FOR [Crimson Hand Inquisitor] --


function spell0_20050(pUnit, Event) --@Mind Flay,n/a--
pUnit:FullCastSpellOnTarget(37276,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20050', 3000, 1)
end

function spell1_20050(pUnit, Event) --@Power Infusion,n/a--
pUnit:FullCastSpellOnTarget(37274,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20050', 15309, 1)
end

function spell2_20050(pUnit, Event) --@Shadow Word: Pain,n/a--
pUnit:FullCastSpellOnTarget(37275,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20050', 18000, 1)
end

function Sorts_20050(pUnit, Event)
local choix_sorts_20050 = math.random(0, 2)
if choix_sorts_20050 == 0 then
pUnit:RegisterEvent('spell0_20050', 1, 1)
end
if choix_sorts_20050 == 1 then
pUnit:RegisterEvent('spell1_20050', 1, 1)
end
if choix_sorts_20050 == 2 then
pUnit:RegisterEvent('spell2_20050', 1, 1)
end
end

function mob20050_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_20050', math.random(1500, 3000), 1)
end

function mob20050_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20050_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20050_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(20050, 1, 'mob20050_Action')
RegisterUnitEvent(20050, 2, 'mob20050_Leave')
RegisterUnitEvent(20050, 3, 'mob20050_Kill')
RegisterUnitEvent(20050, 4, 'mob20050_Die')
